# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Charles Mauch <cmauch@gmail.com>
# Contributor: Francois Charette <firmicus@gmx.net>

pkgname=perl-mail-box
pkgver=3.009
pkgrel=1
pkgdesc="Mail folder manager and MUA backend"
arch=(any)
url="https://search.cpan.org/dist/Mail-Box"
license=('GPL' 'PerlArtistic')
depends=('perl-timedate' 'perl-digest-hmac' 'perl-file-remove>=0.20'
	 'perl-io-stringy' 'perl-mime-types>=1.004' 'perl-mailtools'
	 'perl-object-realize-later>=0.14' 'perl-uri>=1.23'
	 'perl-devel-globaldestruction' 'perl-user-identity>=0.90'
	 'perl-mail-message')
options=('!emptydirs')
source=(https://cpan.metacpan.org/authors/id/M/MA/MARKOV/Mail-Box-$pkgver.tar.gz)
sha256sums=('9185216b0e14c919ec2384769525559491ed7d56d27adb1bc985a1fbeb799165')

prepare() {
  cd  "$srcdir"/Mail-Box-$pkgver
  find . -name '*.pod' -empty -exec rm -f {} \;
}

build() {
  cd  "$srcdir"/Mail-Box-$pkgver
  PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd  "$srcdir"/Mail-Box-$pkgver
#  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""
#    make test
#  )
}

package() {
  cd  "$srcdir"/Mail-Box-$pkgver
  make install DESTDIR="$pkgdir"
  find "$pkgdir" -name '.packlist' -delete
  find "$pkgdir" -name '*.pod' -delete
}
